import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
// 动态  动态权限
import HOME from '../views/home/index.vue'
import Top from '../components/top/index.vue'
export const asyncRoutes: any[] = [
  {
    path:'/home',
    title:'首页',
    components: {
     default: HOME,
     top: Top
    },
    meta: { til: "首页" },
  },
  {
    path:'/paper',
    title:'试卷中心',
    
    components: {
      default:() => import('../views/paper/index.vue'),
      top: Top
    },
    meta: { til: "试卷中心" },
  },
  {
    path:'/do',
    title:'答卷',
    component: () => import('../views/do/index.vue'),
    meta: { til: "答卷", hidden: true },
  }
]
// 静态 路由
export const staticRoutes: RouteRecordRaw[] = [
  {
    path:'/',
    redirect: '/home',
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes: [...staticRoutes, ...asyncRoutes],
});

export default router;